from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.core.urlresolvers import reverse
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from pprint import pprint
from django.conf import settings

def user_is_teacher(request):
    #pprint( settings.TEACHERS )
    #pprint( vars( request.user ) )
    for teacher in settings.TEACHERS:
        #pprint( teacher )
        if request.user.username == teacher:
            #pprint( "Found teacher" )
            return True
    #pprint( "Found student" )
    return False


def int_format(value, decimal_points=3, seperator=u'.'):
    import locale
    locale.setlocale(locale.LC_ALL, '')
    return locale.format('%d', value, True)
